package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * ClassName:VerifyCodeUtil
 * Package: com.atguigu.lease.common.utils
 * Description:
 *
 * @Author Makabaka
 * @Create 2024/9/27 14:36
 * @Version 1.0
 */
public class VerifyCodeUtil {
//    自定义的工具类生成六位随机码   可以用easy-captcha生成
    public static String getVerifyCode(int length) {
        StringBuilder builder = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            builder.append(random.nextInt(10));
        }
        return builder.toString();
    }
}
